home *** CD-ROM | disk | FTP | other *** search
/ Underground / Underground CD1.iso / crack / Howto3a.txt < prev    next >
Encoding:
Text File  |  1999-01-12  |  25.7 KB  |  523 lines

  1.  
  2.             HOW TO CRACK, A TUTORIAL - LESSON 3 (1)
  3.                  by +ORC (the old red cracker)
  4.  
  5. How to crack, an approach                         LESSON 1
  6. How to crack, tools and tricks of the trade       LESSON 2
  7. -> How to crack, hands onn, paper protections     LESSON 3 (1/2)
  8. How to crack, hands on, time limits               LESSON 4
  9. How to crack, hands on, disk-CDrom access         LESSON 5
  10. How to crack, funny tricks                        LESSON 6 (1/2)
  11. How to crack, intuition and luck                  LESSON 7
  12. How to crack windows, an approach                 LESSON 8
  13. How to crack windows, tools of the trade          LESSON 9
  14. How to crack, advanced cracking                   LESSON A (1/2)
  15. How to crack, zen-cracking                        LESSON B
  16. How to crack, cracking as an art                  LESSON C
  17. How to crack                                      INDEX
  18.  
  19. LESSON 3 (1)
  20. HOW TO CRACK, HANDS ON - Password protected programs
  21.  
  22. SOME PROBLEMS WITH INTEL's INT
  23. The INT instruction is the source of a great deal of the
  24. flexibility in the PC architecture, because the ability to get
  25. and set interrupt vectors means that system services (included
  26. DOS itself) are infinitely extensible, replaceable and
  27. MONITORABLE. Yet the Int instruction is also remarkably
  28. inflexible in two key ways:
  29. -    an interrupt handler DOES NOT KNOW which interrupt number
  30.      invoked it.
  31. -    the int instruction itself expects an IMMEDIATE operand:
  32.      you cannot write MOV AX,x21, and then INT AX; you must
  33.      write INT x21.
  34. That would be very good indeed for us cracker... unfortunately
  35. many high level language compilers compile interrupts into PUSHF
  36. and FAR CALL instruction sequences, rather than do an actual INT.
  37. Another method is to PUSH the address of the handler on the stack
  38. and do RETF to it. 
  39.      Some protection schemes attempt to disguise interrupt calls,
  40. 1) camouflaging the code, 2) putting in substitute interrupt
  41. instructions which look harmless and modifying them "on the fly"
  42. or 3) replicating whole interrupt routines inside the code. This
  43. is particularly frequent in the various "disk access" protection
  44. schemes that utilize INT_13 (the "disk" interrupt) and will
  45. therefore be thoroughly explained in -> lesson 5. 
  46.  
  47. A LITTLE BASIC ASSEMBLER
  48. In order to understand the protection schemes and to defeat them,
  49. you must acquire a passing knowledge of assembler, the "machine
  50. language" code. You can find a lot of good, well explained code
  51. for free: viruses are one of the best sources for good "tight and
  52. tricky" assembler code. You can find the source code of almost
  53. all viruses on the web: oddly all the would be hackers seem to
  54. have an aberrant passion for this kind of stuff instead of
  55. studying cracking techniques. But there are millions of lines of
  56. good explained "commercial" assembler code on the net, just fish
  57. it out and study it: the more you know, the better you crack.
  58. I'll restrict myself to some observations, sprinkled throughout
  59. this tutorial. Let's start with some must_know:
  60. ------------------------ STRINGS ----------------------------
  61. The string instructions are quite powerful (and play a great role
  62. in password protection scheme). ALL of them have the property
  63. that:
  64. 1)   The source of data is described by the combination DS:SI
  65. 2)   The destination of data is described by the combination
  66.      ES:DI
  67. 3)   As part of the operation, the SI and/or DI register(s)
  68.      is(are) incremented or decremented so the operation can be
  69.      repeated.
  70. ------------------------- JUMPS -----------------------------
  71. JZ   ero       means what it says
  72. JNZ  ero       means what it says
  73. JG   reater    means "if the SIGNED difference is positive"
  74. JA   bove      means "if the UNSIGNED difference is positive"
  75. JL   ess       means "if the SIGNED difference is negative"
  76. JB   elow      means "if the UNSIGNED difference is negative"
  77. JC   arry      assembles the same as JB, it's a matter of
  78.                aesthetic choice
  79.  
  80. CRACKING PASSWORD PROTECTED PROGRAMS
  81.      Refer to lesson one in order to understand why we are using
  82. games instead of commercial applications as learn material: they
  83. offer the same protection used by the more "serious" applications
  84. (or BBS & servers) although inside files that are small enough
  85. to be cracked without loosing too much time.
  86.      A whole series of programs employ copy protection schemes
  87. based upon the possess of the original manual or instructions.
  88. That's obviously not a very big protection -per se- coz everybody
  89. nowadays has access to a photocopier, but it's bothering enough
  90. to motivate our cracks and -besides- you'll find the same schemes
  91. lurking in many other password protected programs. 
  92.      Usually, at the beginning of the program, a "nag screen"
  93. requires a word that the user can find somewhere inside the
  94. original manual, something like: "please type in the first word
  95. of line 3 of point 3.3.2". Often, in order to avoid mistakes, the
  96. program indicates the first letter of the password... the user
  97. must therefore only fill the remaining letters.
  98.  
  99. Some examples, some cracks:
  100. ---------------------------------------------------
  101. UMS (Universal Military Simulator) version 1
  102. by Dr Ezra SIDRAN
  103. (c) 1987 Intergalactic Development
  104. European Union:     Rainbird Software
  105. United States:      Firebird Software
  106. ---------------------------------------------------
  107.      This very old EGA program is one of the first I cracked in
  108. my youth, and it's very interesting coz it employs a very basilar
  109. protection scheme (a "PRIMITIVE"! More than 80% of the protection
  110. schemes used to day (January 1996) are directly derived from one
  111. of the 12 primitives.
  112.      The nag screen snaps at the beginning and keeps indefinitely
  113. asking your answer, only the use of CTRL+C will bring you out of
  114. it, back to DOS. That's a clear sign of older protection schemes:
  115. newer schemes let you in for only 3 attempts or even only one,
  116. and pop out to the OS if you fail. In UMS, besides, there is no
  117. "first letter" aid, a later improvement.
  118.      The cracking procedure for password protected programs is,
  119. first of all, to find out where are stored the letters that you
  120. type in. So examine your memory map, find out where the program
  121. dwells in memory, do a snap save of these memory areas and a
  122. series of snap compares as you type your password in.
  123.      Strangely enough, in the case of UMS, as you type your
  124. password there seems to be no difference at all in the memory
  125. locations where this program dwells... yet the data must be
  126. somewhere... Usually such a situation is a clear sign that an
  127. hooked interrupt is used to hide the data.
  128.      Checking the hooked vectors you find out the following:
  129. vecs 00, 02, 22          are hooked where needs be
  130. vecs 34-3D               are hooked at xxxx:0
  131. vec  3E                  is hooked at xxxx:00CA
  132.      Ha! Let's have a closer look at this bizarre 3E hook. Let's
  133. search for some words used in the nag_screen and then let's dump
  134. the area where we find them (in UMS that will be at 3E_hook
  135. address + 7656) and loo! You'll see the content of the nag screen
  136. and, immediately afterwards, ALL the passwords "in extenso", i.e.
  137. not encoded, not scrambled, nothing at all... THERE THEY ARE
  138. (that's a very old protection scheme indeed). You could now, for
  139. instance, easily patch all the different passwords to (for
  140. instance) "PASS", and this would work... it's a very primitive
  141. protection, as we said, nevertheless the use of a hooked vector
  142. as hiding place for the protection code is not yet obsolete...
  143. we'll find it elsewhere, in many "more modern" programs.
  144.  
  145.      Now let's go deeper and examine the "compare" mechanism, we
  146. want to crack, here, not just to patch.
  147.      Password protected programs (and access protection routines
  148. for server and BBS, for that matter) have quite a lot of weak
  149.  
  150. points. The most obvious one (you 'll find out the other when
  151. you'll high crack) is that they MUST compare the password of the
  152. user with the original one(s). So you do not need to steal a
  153. password, you just need to "ear" the echo of the original one in
  154. the memory locations used for the compare, or, and that's more
  155. correct, to crack the compare mechanism itself so as to make it
  156. let you in even with a totally false password.
  157.      The compare mechanism of UMS can be found setting a
  158. breakpoint on the memory range that covers the three locations
  159. where the password is stored (and you 'll find these with your
  160. search capabilities and with a pair of snap compares):
  161. ES:0F8E   (here you 'll see a copy of the password that the
  162.           program is asking)
  163. ES:0F5C   (here you 'll see a copy of the password that the user
  164.           types in)
  165. INT_3E hook_address + 7656 (here are all the possible passwords
  166.           in extenso).
  167.  
  168. Here is how the protection scheme looks out:
  169.  
  170. MOV       CX,FFFF        Charge MAX in CX
  171. REPNZ     SCASB          Scan ES:DI (the user password)
  172. NOT       CX             Now CX holds the number of the
  173.                          character that the user typed in
  174. MOV       DI,SI          Real password offset to DI
  175. LDS       SI,[BP+0A]     User password offset in SI
  176. REPZ      CMPSB          Compares DS:SI with ES:DI (user
  177.                          password and real password) then snap
  178.                          out at CX=0 or at char_different,
  179.                          whichever comes first.
  180. Nice, we found the compare schema... how do we crack it now?
  181. There are many elegant solutions, but let's remain on a basic
  182. level... you look at the code that follows the CMPSB searching
  183. the "snapping schema"... here it is immediately afterwards
  184. (that's the case in most of the primitives). Remember: we sprung
  185. out of the CMPSB check at the first different char, OR at the end
  186. of the count of the user chars. Here it is what follows:
  187.      MOV  AL,[SI-01]     loads in AL the before_different char
  188.                          of the user password (should be zero)
  189.      SUB  AL,ES:[DI-01]  subs with the before_different char of
  190.                          the real password (should be zero)
  191.      CBW                 zero flag set, "TRUE", if OK_match
  192. Well let's now look for the next JZ near (it's a "74" code)
  193.      CS:IP 740D     JZ  location no_good
  194. Wait, let's continue a little... is there another check (often
  195. you have a double check on DI)... yes there is!
  196.      CS:IP 7590     JNZ location no_good
  197. Cracking such a schema is very easy: you just need to substitute
  198. 75 to 74 and 74 to 75: transform your JZ in a JNZ and the JNZ in
  199. a JZ... now you will always pass, no matter what you write,
  200. unless you exactly guess the password!
  201.  
  202. Now let's quickly crack it:
  203. ------------------------------------------------
  204. CRACKING UMS.EXE (by +ORC, January 1996)
  205.  
  206. ren ums.exe ums.ded
  207. symdeb ums.ded
  208. -    s (cs+0000):0 Lffff 74 0D 1E B8 C2 3F
  209. (nothing)
  210. -    s (cs+1000):0 Lffff 74 0D 1E B8 C2 3F
  211. (nothing)
  212. -    s (cs+2000):0 lffff 74 0D 1E B8 C2 3F
  213. xxxx:yyyy           (this is the answer of the debugger)
  214. -    e xxxx:yyyy    75
  215. -    e xxxx:yyyy+17 74
  216. -    w
  217. -    q
  218. ren ums.ded ums.exe
  219. -------------------------------------------------
  220.  
  221.      In the debug/symdeb crack above we use as search string the
  222. bytes comprising and following immediately the first JZ.
  223. I know, I know... we saw them in [Soft-ice] and we could have
  224. modified them there, but I'm teaching also pupils who may not
  225. have [Soft-ice]. 
  226.      Note that the program is x431A0 bytes long, and therefore
  227. has a BX=4 sectors adding to the CX=31A0 in the initial
  228. registers... that's the reason I wanted to examine all the
  229. sectors (even if I knew that the snap was in sector (cs+2000):
  230. that's good practice! If you do not find your string in the first
  231. sector you must search for it in the next sectors, till you find
  232. it, coz in many programs there may be MORE THAN ONE repetitions
  233. of the same schema (more about this double check later).
  234. That's it, pupils, that's the way to crack old [UMS.EXE].
  235.  
  236. Let's go over, now, to more elaborate and more modern password
  237. protection schemes.
  238.  
  239. --------------------------------------------------------
  240. LIGHTSPEED, from Microprose (we crack here version 461.01)
  241. --------------------------------------------------------
  242.      This program, released in 1990, operates a more "modern"
  243. variation of the previous scheme. You 'll find this variation in
  244. many access routines of remote servers (and this makes it very
  245. interesting indeed).
  246.      Let's begin as usual, with our hooked vectors examination
  247. and our snap compares.
  248. Hooked vectors: 00, 08, 1B, 22, 23: nothing particular.
  249. The snap_comparisons of the main memory area -as you type the
  250. password in- gives more than six pages of changing locations...
  251. that's clearly much too much to examine.
  252. What now?
  253.      Sit down, have a Martini Wodka (I'm afraid that only
  254. Moskovskaja 'll do) and meditate. Get the memory map of the
  255. program's layout. Start anew: snap_save (before typing anything
  256. in). Type as password "ABCDE". Get the print of the snap
  257. compares. Sit down, sip Martini Wodka, relax. You know that the
  258. code for A is x41, for B x42, for C x43 and so on... and in the
  259. snap_compares, that you made between letters, you 'll have only
  260. some locations with these values changing. Focus on these. 
  261.      You 'll soon enough find out that for LIGHTSPEED absolute
  262. location (in my computer) 404307, i.e.: relative locations (in
  263. my computer) 30BE:F857 or 4043:0007 evoke the characters you
  264. type, i.e. something like 
  265. -----------------------------------------------------
  266. F855 F856 F857                F858                F859...
  267. 41   3E   first_ready_letter  your_1st_letter     your_2nd_one...
  268. -----------------------------------------------------
  269. Inspecting the same prints, you 'll find out that absolute
  270. location 30C64 (imc) or relative location 30BE:F83E evokes the
  271. LAST character you typed in. The relative code line is:
  272.      CS:0097   MOV  AX,[BP-08] where SS:F83E = 00+letter_code
  273.      Now breakpoint at these locations and investigate what's
  274. going on (for instance, the instruction that follows is 
  275.      CS:009A   MOV [BX], AX 
  276. and this means that the code of the letter you just typed in will
  277. be now copied in BX=F85A. What else can you do? Time to use a
  278. little intuition: look for an instruction "CMP AX,000D", which
  279. is the typical "IF the user hits ENTER then" instruction, coz
  280. "x1D" its the ENTER keystroke. This must be somewhere around
  281. here. Ha! You 'll soon enough find the line
  282.      CS:0073  3D0D00     CMP AX,000D
  283. And now the way is open to the crack. But YOU DO NOT NEED ALL
  284. THIS! Since the password protection schemes are -as I told you-
  285. all more or less the same, I would suggest that you use first of
  286. all following trick: in the largest part of the program (use
  287. memory map to see where the program dwells) search the "F3A6"
  288. sequence, that's instruction REPZ CMPSB.
  289.      In the case of Lightspd you 'll get as answer FOUR addresses
  290. with this instruction: (pgsg=program main segment)
  291.      pgsg:C6F9
  292.      pgsg:E5CA
  293.      pgsg:E63E
  294.      pgsg:EAB0
  295. There you are! Only four... have a short look at each of them:
  296. you 'll see that the second one (pgsg:E5CA) is the "good" one.
  297. The compare mechanism in this program of 1990 it's more or less
  298. the same as in 1987'UMS (and do believe me: the same mechanism
  299. is still in use to day (1996)!
  300. B9FFFF    MOV       CX,FFFF   charge Max in CX
  301. F2AE      REPNZ     SCASB     this scans ES:DI (the original
  302.                               password)
  303. F7D1      NOT       CX        so many chars in the original pw
  304. 2BF9      SUB       DI,CX     change DI for compare
  305. F3A6      REPZ      CMPSB     compares DS:SI with ES:DI (real
  306.                               pw with user pw) then snaps out
  307.                               at CX=0 or at char_differs
  308.      See how easy? They all use the same old tricks the lazy
  309. bastards! Here the section is preceded by a small routine to
  310. lowercase the user password, coz the original muster is always
  311. lowercased.
  312.      Now you would like, may be, to breakpoint at one of these
  313. locations, in order to stop the program "in the snap area" and
  314. inspect the snap mechanism... that WILL NOT DO with a "fixed"
  315. breakpoint, coz these locations are called by the snap with a
  316. different segment:offset numeration as the one you found (that's
  317. old dos magic). So you MUST first set a memory_read/write
  318. breakpoint on these locations, and then get at them at the snap.
  319. Now you can find out the segment:offset used by the snap and only
  320. now you'll be able to set a fixed breakpoint (for instance on the
  321. NOT CX instruction).
  322.      Now run the program and breakpoint in: have a dump of the
  323. ES:DI and see the original password. How nice! We have now the
  324. original password in extenso in our memory dump window. That's
  325. the "echo". By the way, there is a whole school of cracking
  326. devoted to find and use these echoes... we work on different
  327. paths, nevertheless password fishing can be interesting: where
  328. are the password stored? From which locations do they come from?
  329. A common practice of the protectionists is to hide them in
  330. different files, far away, or in hooked vectors, or in SMC parts.
  331. This is a program of 1990, that differs in respect to UMS: the
  332. passwords are not "hidden" inside a hooked vector, coz that's a
  333. pretty stupid protection: any hexdump utility would still permit
  334. you to see them. Here the passwords are encoded (albeit in a very
  335. primitive manner): looking for them (with memory range
  336. breakpoints) you'll quickly find a section of the program code
  337. that looks like this:
  338. sg:0118   8C 91 9D 95 9B 8D 00 B8 EC 94 9B 8D 8F 8B 9B
  339. sg:0128   94 9B 8D 00 AE EC 9C 9B 8A 9B 86 00 A9 EC 91
  340. This is a typical encoded matrix, with clear 00 fences between
  341. the encoded passwords.
  342. Ha! If all codes where so easy to crack! This is no better than
  343.  
  344. children's crypt! It's a NEG matrix! And there is direct
  345. correspondence: 91=6F="o"; 92=6E="n"; 93=6D="m" and so on... Ha!
  346.      Let's now leave the "hidden" passwords and proceed with our
  347. cracking... let's follow the snap procedure after the REPZ CMPSB
  348. instruction looking for the "jump to OK" instruction...
  349. F3A6      REPZ      CMPSB          ; compares DS:SI with ES:DI 
  350. 7405      JZ   preserved_AX=0000   <--- Here the first JZ
  351. 1BC0      SBB  AX,AX
  352. ADFFFF    SBB  AX,FFFF   
  353. :preserved_AX=0000
  354. 8BF3      MOV  SI,BX
  355. 8BFA      MOV  DI,DX
  356. 5D        POP  BP
  357. CB        RETF
  358. ....
  359. 83C404    ADD  SP,+04
  360. 0BC0      OR   AX,AX
  361. 7509      JNZ  0276                <------ And here it is!
  362.      Now, remembering the UMS crack, you would probably want to
  363. change the JZ instruction in a JNZ instruction (you tried it on
  364. the fly INSIDE  [Soft-Ice] and it did work!), the "74" with a
  365. "75" also. And then you would like to change the JNZ instruction
  366. in a JZ instruction... Please feel free to try it... it will NOT
  367. work! (You will not even find the second JNZ in the program
  368. code). You should always be aware of the SMC (self modifying
  369. code) protections: parts of the code my be decrypted "on the
  370. fly", as needs arise, by the program. The code you modify while
  371. the program is running may be different from the code of the
  372. "dead" program.
  373.      Here we have a small "improvement" of the primitive: the
  374. same instruction is used as "muster" for manipulation of other
  375. parts of the program... if you do change it in a JNZ you get an
  376. overlay message and the program pops out with instability! You
  377.  
  378. cannot easily modify the JNZ instruction either, coz the part
  379. after the RETF will be compiled "on the fly" by lightspeed, and
  380. you would therefore have to search the decryption mechanism and
  381. modify the original encrypted byte somewhere... and may be they
  382. do encrypt it twice... and then you must hack all night long...
  383. very annoying.
  384.      So do the following: back to the snap, a sip of martini-
  385. Wodka and meditate: loo! The only thing that happens after the
  386. JZ, is the setting of the AX register to flag *FALSE* (AX=1...
  387. that's what the two SBB instructions do) if the snap went out
  388. with a non-zero flag... i.e. if you did not know the password.
  389. So let's nop the 5 bytes of the two SBB instructions, or, more
  390. elegantly, let's have a INC AX, DEC AX, NOP, INC AX, DEC AX
  391. sequence instead of the two SBB! There is a good reason to use
  392. a sequence of working instructions instead of a series of NOPs:
  393. recent protection schemes "smell" patched nops inside the program
  394. and trash everything if they find more than -say- three
  395. consecutive NOPs! You should always try to choose THE LESS
  396. INTRUSIVE and MORE "CAMOUFLAGED" solution when you crack!
  397.      Eliminating the two SBBs we get our crack! No need to bother
  398. with the second JNZ either... the program will work as if you got
  399. the password if you have it AND if you do not (that's better as
  400. the previous type of crack -seen for UMS- when you crack computer
  401. accesses: hereby the legitimate user will not have any suspects
  402. 'coz the system will not shut him out... everybody will access:
  403. the good guys and the bad ones... that's nice isn't it?).
  404.  
  405.      Now let's quickly crack LIGHTSPD:
  406. ------------------------------------------------
  407. CRACKING LIGHTSPEED.EXE (by +ORC, January 1996)
  408.  
  409. ren lightspd.exe lightspd.ded
  410. symdeb lightspd.ded
  411. -    s (cs+0000):0 Lffff 2B F9 F3 A6 74
  412. xxxx:yyyy           (this is the answer of the debugger)
  413. -    s (cs+1000):0 Lffff 2B F9 F3 A6 74
  414. (nothing, but do it nonetheless, just to be sure)
  415. -    s (cs+2000):0 lffff 2B F9 F3 A6 74 
  416. (nothing, just to be sure, now it's enough)
  417. -    e xxxx:yyyy+6  40 [SPACE] 48 [SP] 90 [SP] 40 [SP] 48
  418. -    w
  419. -    q
  420. ren lightspd.ded lightspd.exe
  421. -------------------------------------------------
  422.  
  423. All this CMPSB is very common. Some programs, nevertheless,
  424. utilize a password protection scheme that is slightly different,
  425. and does not rely on a F3A6 REPZ CMPSB instruction. Let's
  426. analyze, for instance, the protection scheme used in the first
  427. version of Perfect general I from QQP-White wolf, July 1992.
  428. When you break in, at the nag screen, you are in the middle of
  429. the BIOS procedures, coz the program expects your input (your
  430. password, that's is). You 'll quickly find out (MAP MEMORY
  431. USAGE!) that [General.exe] dwells in two main areas; Setting
  432. breakpoints on memory write you 'll find out that the memory area
  433. "queried" by the protection mechanism is
  434.      xxxx:1180 to xxxx:11C0
  435. where xxxx represents the second of the memory segments where the
  436. program dwells. Now do the following (a very common cracking
  437. procedure):
  438. *    Breakpoint on memory range WRITE for the small memory area
  439.      touched by the program in querying you for the password.
  440. *    Breakpoint TRACE on the whole memory range of the MAIN
  441.      CODE.
  442. *    Run anew everything
  443. It's already done! Now it's your intuition that should work a
  444. little: Here the last 9 traces (traces [!], not instructions
  445. following on a line) before the calling of the procedure sniffing
  446. your memory area:
  447.  
  448. -9   xxxx:0185 7425           JZ   somewhere, not taken
  449. -8   xxxx:0187 2D1103         SUB  AX,0311
  450. -7   xxxx:018A 7430           JZ   somewhere, not taken
  451. -6   xxxx:018C 2DFD04         SUB  AX,04FD
  452. -5   xxxx:018F 7443           JZ   next_trace, taken
  453. -4   xxxx:01D4 E85500         CALL funny_procedure 
  454. -3   xxxx:022C 803E8F8C11     CMP  BYTE PTR[8C8F],11
  455. -2   xxxx:0231 750E           JNZ  somewhere, not taken
  456. -1   xxxx:0233 9A0A0AC33E     CALL procedure_that_sniffs
  457.                                    our_memory_area
  458.  
  459. Well, the call to funny_procedure followed by a byte compare
  460. "feels" fishy from very far away, so let's immediately look at
  461. this part of the code of [General.exe]
  462. :funny_procedure
  463.      803E8F8C11     CMP  BYTE PTR[8C8F],11
  464.      750E           JNZ  compare_byte
  465.      9A0A0AC333     CALL procedure_that_sniffs
  466.      0AC0           OR   AL,AL
  467.      7405           J2   compare_byte
  468.      C6068F8C2A     MOV  BYTE PTR [8C8F],2A
  469. :compare_byte
  470.      803E8F8C2A     CMP  BYTE PTR [8C8F],2A
  471.      7504           JNZ  after_ret
  472.      B001           MOV  AL,01
  473.      C3             RET  
  474. You should be enough crack-able ;=), by this lesson, to notice
  475. immediately the inconsistency of the two successive instructions
  476. MOV 2A and CMP 2A, coz there would be no sense in comparing the
  477. "2A" in order to JNZ to after_ret if you just had the 2A set with
  478. the precedent MOV instruction... but the first JNZ jumps to the
  479. compare WITHOUT putting the "2A" inside. And "2A" is nothing else
  480. as the "*" symbol, commonly used by programmer as "OK"! This
  481. protection works in the following way (this is the above code
  482. explained):
  483. -    compare holy_location with 11
  484. -    jump non zero to compare holy_loc with "*"
  485. -    else call sniffing protection part
  486. -    or al,al (al must be zero, else)
  487. -    jump zero to compare holy_loc with "*"
  488. -    if al was zero mov "*" inside holy_loc
  489. -    compare holy_loc with "*"
  490. -    if there is a difference then JNZ beggar_off_ugly_copier
  491. -    else ret_ahead_nice_buyer
  492.  
  493. Now let's quickly crack it:
  494. ------------------------------------------------
  495. CRACKING GENERAL.EXE (by +ORC, January 1996)
  496.  
  497. ren general.exe general.ded
  498. symdeb general.ded
  499. -    s (cs+0000):0 Lffff 8C 11 75 0E
  500. xxxx:yyyy           (this is the answer of the debugger)
  501. -    e xxxx:yyyy+2  EB [SPACE] 09 
  502. -    w
  503. -    q
  504. ren general.ded general.exe
  505. -------------------------------------------------
  506. And in this way you changed the JNZ to the cmp "*" instruction
  507. in a JMP to the mov "*" instruction. So no more nag screens, no
  508. more protections... serene, placid, untroubled [general.exe].
  509.  
  510.  
  511. Well, that's it for this lesson, reader. Not all lessons of my
  512. tutorial are on the Web.
  513.      You 'll obtain the missing lessons IF AND ONLY IF you mail
  514. me back (via anon.penet.fi) with some tricks of the trade I may
  515. not know that YOU discovered. Mostly I'll actually know them
  516. already, but if they are really new you'll be given full credit,
  517. and even if they are not, should I judge that you "rediscovered"
  518. them with your work, or that you actually did good work on them,
  519. I'll send you the remaining lessons nevertheless. Your
  520. suggestions and critics on the whole crap I wrote are also
  521. welcomed.
  522.  
  523. +ORC an526164@anon.penet.fi